<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
<script type="text/javascript">
$.subscribe('refreshGridLeaves', function(event, data) {
	url = 'ts-leaves-load-list.action';
	$("#gridLeaves").jqGrid('setGridParam', {
		url : url
	}).trigger("reloadGrid");
});
function cancelButton() {
	$('#ProcessDialog').dialog('close');
	/*
	$("#content").empty();
	$('#content').load("ts-report.action");
	*/
	// refresh the grid
	url = 'ts-leaves-load-list.action';
	$("#gridLeaves").jqGrid('setGridParam', {
		url : url
	}).trigger("reloadGrid");
};
</script>
<!-- 
<h2>Danh sách thiết bị check in/out</h2>
 -->
<div>
	<s:form theme="xhtml" id="import_form" action="ts-upload-myleaves.action" method="post" enctype="multipart/form-data">
		<sj:div>
			<s:file id="fileUpload" name="fileUpload"></s:file>
		</sj:div>
	</s:form>
</div>
<sj:a id="formSubmit2" formIds="import_form" href="#" targets="topDiv" button="true" indicator="indicator" buttonIcon="ui-icon ui-icon-pencil" onCompleteTopics="refreshGridLeaves">Nhận</sj:a>
<div>
	<s:url var="noneurl" action="none" namespace="/"/>
	<sjg:grid
	 	id="gridLeaves"
	 	dataType="json"
	 	href="%{noneurl}"
	 	gridModel="leaves"
	 	rowNum="-1"
	 	rownumbers="true"
	 	scroll="false"
	   	shrinkToFit="true"
	   	width="900"
	 >
	 	<sjg:gridColumn name="username" index="username" title="Username" sortable="false" width="80"/>
	 	<sjg:gridColumn name="fullname" index="fullname" title="Username" sortable="false" width="200"/>
	 	<sjg:gridColumn name="fromDate" index="fromDate" title="Applied Date" sortable="false" displayTitle="false" align="center" width="100"
	 	 	formatter="date" 
	 	 	formatoptions="{newformat : 'd/m/Y', srcformat : 'Y/m/d'}"
	 	/>
	 	<sjg:gridColumn name="halfDay" index="halfDay" title="Half Day" sortable="false" displayTitle="false" align="center" width="50"/>
	 	<sjg:gridColumn name="leaveType" index="leaveType" title="Leave Type" sortable="false" width="200"/>
	 	<sjg:gridColumn name="reason" index="reason" title="Reason" sortable="false"/>
	 </sjg:grid>
</div>